package com.xinda.admin.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xinda.admin.dao.ProviderMapper;
import com.xinda.admin.pojo.Provider;
import com.xinda.admin.vo.OrderEditVo;
  
@Service  
public class ProviderService{  
	
    @Autowired 
    private ProviderMapper providerMapper; 
    
    //1.select providers;
    public List<Provider> listProvider(){	
    	return providerMapper.selectProviders();
    }
    
   
   //2.insert provider;
    public void insertProvider(Provider provider){
    	providerMapper.insertProvider(provider);  
    }  
    
    
   //3.edit provider;
   public Provider readProvider(int id){
    	return providerMapper.readProvider(id);
    }
    
  /*  public void editProvider(Provider provider){
    	providerMapper.editProvider(provider);
    }
    */
    
    //4.delect provider;
    public void deleteProvider(int id){
    	providerMapper.deleteProvider(id);
    }
    
    
    //5.delect providers;
	public void deleteProviders(String[] id) {
		providerMapper.deleteProviders(id);
	}
	
	//6.deactivate provider;
	public void deactivateProvider(Integer id){
		providerMapper.deactivateProvider(id);
	}
	
	//7.start provider;
	public void startProvider(Integer id){
		 providerMapper.startProvider(id);
   } 
	
	//8.providerDeactivateList
	public List<Provider> showProvider(){	  
		return providerMapper.showProviders();
	 }
	
	
	//9.providerSellRecords
	public List<OrderEditVo> orderProvider(int id){
		return providerMapper.getProvider(id);
	}
  /* public Provider deactivateProvider(int id){
   	return providerMapper.showProvider(id);
   }*/
   
 
   /*public List<Provider> listDeactivateProvider(){	
   	return providerMapper.selectDeactivateProviders();
   }*/
   
   
   /*  
    public void recordProvider(Provider provider){
    	providerMapper.recordProvider(provider);
    }  
   */
    /*
   public void showProvider(Provider provider){
    	providerMapper.recordProvider(provider);
    }
    */
} 



